<template>
    <div class="share">
        <div class="equity">
            <div
                class="equity-title fs-16 fw-500 dis-flex flex-x-between flex-y-center"
            >
                <div>升级助手</div>
                <img src="../../../assets/img/Equity_Goose.png" alt="" />
            </div>
            <div class="equity-center fs-12">
                <div class="mb-9">
                    <span style="color: #f53137">邀</span>
                    <span class="num">2</span>
                    <span style="color: #f53137">人</span>
                    <span>激活，升团长</span>
                </div>
                <div class="mb-9" v-if="false">
                    <span>您成功邀请</span>
                    <span class="num">2</span>
                    <span style="color: #f53137">人</span>
                    <span>激活，已升级为</span>
                    <span class="num">团长</span>
                </div>
                <div>
                    <van-progress
                        color="#f24b3a"
                        track-color="#fff"
                        :percentage="percentage"
                    />
                </div>
                <div class="statistics">
                    <span class="active">0人</span>
                    <span>1人</span>
                    <span>2人</span>
                </div>
                <div class="mt-16">
                    <span>升级成团长，可赚团队</span>
                    <span style="color: #f53137">万4手续费</span>
                </div>
            </div>
            <!-- 头像 -->
            <div class="avatar">
                <div class="first">
                    <img
                        src="https://img1.baidu.com/it/u=3538711794,4285740787&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1721754000&t=018589de4a1d1017b261f6d0ddc3bec7"
                        alt=""
                    />
                    <span class="flag">激活</span>
                </div>
                <div class="second">
                    <span>?</span>
                </div>
            </div>

            <div class="invite-btn">再邀请2人激活，即升为团长</div>
            <!-- <div class="invite-btn">持续邀请，赚更多</div> -->
            <div class="rules">
                <span @click="openPopup">升级团长规则</span>
                <van-icon name="arrow" color="#0077FF" size="0.4267rem" />
            </div>
        </div>

        <div class="card" @click="goPalcard">
            <div class="logo">
                <img src="../../../assets/img/zhi.png" alt="" />
            </div>
            <div class="text">
                <span>一键分享，邀请注册</span>
                <span>快速锁定 轻松获客</span>
            </div>
            <div class="btn">
                <img src="../../../assets/img/zhi.png" alt="" />
            </div>
        </div>
        <div class="card" @click="goHelp">
            <div class="logo">
                <img src="../../../assets/img/zhi.png" alt="" />
            </div>
            <div class="text">
                <span>协助用户，开通账号</span>
                <span>快速开通 上帮下扶</span>
            </div>
            <div class="btn">
                <img src="../../../assets/img/zhi.png" alt="" />
            </div>
        </div>

        <!-- 规则 -->
        <van-popup
            v-model="rulesPopup"
            position="bottom"
            :style="{ height: '70%' }"
            :close-on-click-overlay="false"
            @click-overlay="closeRules"
        >
            <div class="popup-content">
                <div
                    class="title dis-flex flex-x-center flex-y-center fs-18 fw-500"
                >
                    <p>升级团长规则</p>
                    <img
                        @click="closeRules"
                        src="../../../assets/img/close.svg"
                        alt=""
                    />
                </div>
                <div class="rules-content" v-html="rules.activityContent"></div>
            </div>
        </van-popup>
    </div>
</template>

<script>
    export default {
        props: [], // 父辈向子辈传参
        name: 'share',
        components: { // 组件的引用

        },
        data() {
            return {
                percentage: 3,
                rulesPopup: false,
                rules: {}
            }
        },
        methods: {
            openPopup() {
                this.rulesPopup = true
            },
            closeRules() {
                this.rulesPopup = false
            },
            goPalcard(){
                this.$router.push("/placard")
            },
            goHelp(){
                this.$router.push("/helpRegister")
            },
        },
        computed: {},
        watch: {},
        created() { },
        mounted() { },
    }
</script>
    
<style scoped lang='scss'>
    ::v-deep(.van-progress__pivot) {
        display: none;
    }
    .share {
        padding-bottom: 20px;
        .equity {
            background: #ffffff;
            border-radius: 10px;
            margin: 20px auto 0;
            width: 343px;
            padding: 0 0 16px;
            box-sizing: border-box;

            .equity-title {
                color: #000000;
                padding: 0 16px;
                box-sizing: border-box;

                & > img {
                    width: 105px;
                    height: 46px;
                }
            }
            .equity-center {
                background: #fff6f7;
                border-radius: 6px;
                padding: 15px 16px 12px;
                margin: 0 16px;
                box-sizing: border-box;
                border: 1px solid #ffebed;
                box-sizing: border-box;
                .num {
                    font-size: 24px;
                    font-weight: 600;
                    color: #f53137;
                }
                .statistics {
                    display: flex;
                    justify-content: space-between;
                    font-weight: 400;
                    font-size: 12px;
                    color: #999999;
                    line-height: 12px;
                    margin: 8px 0 0px;
                }
                .active {
                    color: #f53137;
                }
            }

            .avatar {
                padding: 24px 0;
                display: flex;
                justify-content: center;
                border-bottom: 1px dashed #cccccc;

                .first {
                    position: relative;
                    margin-right: 29px;
                    & > img {
                        width: 48px;
                        height: 48px;
                        border-radius: 50%;
                    }

                    .flag {
                        position: absolute;
                        top: -5px;
                        width: 28px;
                        height: 16px;
                        background: #ffa543;
                        border-radius: 8px 8px 8px 8px;
                        font-weight: 400;
                        font-size: 10px;
                        color: #ffffff;
                        line-height: 12px;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                    }
                }
                .second {
                    width: 48px;
                    height: 48px;
                    border-radius: 50%;
                    border: 1px dashed #999999;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    font-size: 28px;
                    font-weight: 400;
                    color: #999999;
                }
            }

            .invite-btn {
                width: 298px;
                height: 48px;
                background: #f24b3a;
                border-radius: 24px 24px 24px 24px;
                display: flex;
                align-items: center;
                justify-content: center;
                font-weight: 600;
                font-size: 16px;
                color: #ffffff;
                line-height: 16px;
                margin: 15px auto 16px;
            }

            .rules {
                display: flex;
                align-items: center;
                justify-content: center;
                font-weight: 400;
                font-size: 14px;
                color: #0077ff;
                line-height: 13px;
                margin-right: 4px;
            }
        }

        .card {
            border-radius: 10px;
            width: 343px;
            padding: 12px 14px;
            box-sizing: border-box;
            background: #ffffff;
            margin: 12px auto 0;
            display: flex;
            justify-content: space-between;

            .logo {
                font-size: 0;
                margin-right: 12px;
                & > img {
                    width: 44px;
                    height: 44px;
                }
            }
            .text {
                flex: 1;
                display: flex;
                flex-direction: column;
                justify-content: space-between;
                & > span:nth-child(1) {
                    font-weight: 500;
                    font-size: 15px;
                    color: #f24b3a;
                    line-height: 16px;
                }
                & > span:nth-child(2) {
                    font-weight: 500;
                    font-size: 14px;
                    color: #999999;
                    line-height: 16px;
                }
            }
            .btn {
                font-size: 0;
                align-self: center;
                & > img {
                    width: 20px;
                    height: 20px;
                }
            }
        }

        .popup-content {
            padding-bottom: 24px;
            .title {
                padding-top: 20px;
                position: relative;
                color: #121836;
                & > img {
                    width: 16px;
                    height: 16px;
                    position: absolute;
                    bottom: 0;
                    right: 16px;
                }
            }
            .rules-content {
                margin-top: 17px;
                border-top: 1px solid #eee;
                padding: 16px;
                overflow: auto;
                font-size: 16px;
            }
        }
    }
</style>